#pragma once

typedef struct{
    // 内存信息
    unsigned long long total;
    unsigned long long free;
    unsigned long long used;
    unsigned long long buff;
    unsigned long long cached;
    unsigned long long swap_total;
    unsigned long long swap_free;
    unsigned long long swap_used;
    // 计算使用率
    float mem_percent;
    float swap_percent;
}sysMem_t;

class MonitorMem
{
public:
    MonitorMem();
    ~MonitorMem();
    // 获取系统内存信息
    sysMem_t* update_sys_mem();
    void show_sys_mem(sysMem_t* sysMem);
    unsigned long long get_total_mem();

private:
    // 获取内存信息
    sysMem_t sysMem_;
    const char FILE_PROCFS_MEMINFO[32] = "/proc/meminfo";
};
